home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / src / win32.h < prev    next >
C/C++ Source or Header  |  1996-06-09  |  3KB  |  126 lines

  1. /* vi:set ts=4 sw=4:
  2.  *
  3.  * VIM - Vi IMproved        by Bram Moolenaar
  4.  *
  5.  * Do ":help uganda"  in Vim to read copying and usage conditions.
  6.  * Do ":help credits" in Vim to see a list of people who contributed.
  7.  */
  8.  
  9. /*
  10.  * Win32 (Windows NT and Windows 95) machine-dependent things.
  11.  */
  12.  
  13. #define CASE_INSENSITIVE_FILENAME    /* ignore case when comparing file names */
  14. #define SPACE_IN_FILENAME
  15. #define BACKSLASH_IN_FILENAME
  16. #define USE_FNAME_CASE            /* adjust case of file names */
  17. #define BINARY_FILE_IO
  18. #define USE_CRNL                /* lines end in CR-NL instead of NL */
  19. #define USE_VIM_REMOVE
  20. #define USE_VIM_CHDIR
  21. #define USE_MOUSE                /* include mouse support */
  22. #define SYNC_DUP_CLOSE            /* sync() a file with dup() and close() */
  23. #define HAVE_STRING_H
  24. #define HAVE_STRCSPN
  25. #define HAVE_MEMSET
  26. #define USE_TMPNAM                /* use tmpnam() instead of mktemp() */
  27. #define HAVE_LOCALE_H
  28. #define HAVE_FCNTL_H
  29. #define HAVE_QSORT
  30. #if defined(__DATE__) && defined(__TIME__)
  31. # define HAVE_DATE_TIME
  32. #endif
  33. #define BREAKCHECK_SKIP        1        /* call mch_breakcheck() each time, it's
  34.                                        quite fast */
  35.  
  36. #define SIZEOF_INT 4
  37.  
  38. /*
  39.  * Names for the EXRC, HELP and temporary files.
  40.  * Some of these may have been defined in the makefile.
  41.  */
  42.  
  43. #ifndef USR_VIMRC_FILE
  44. # define USR_VIMRC_FILE    "$VIM\\_vimrc"
  45. #endif
  46.  
  47. #ifndef USR_EXRC_FILE
  48. # define USR_EXRC_FILE    "$VIM\\_exrc"
  49. #endif
  50.  
  51. #ifndef VIMRC_FILE
  52. # define VIMRC_FILE        "_vimrc"
  53. #endif
  54.  
  55. #ifndef EXRC_FILE
  56. # define EXRC_FILE        "_exrc"
  57. #endif
  58.  
  59. #ifndef VIM_HLP
  60. # define VIM_HLP        "$VIM\\vim_help.txt"
  61. #endif
  62.  
  63. #ifdef VIMINFO
  64. # ifndef VIMINFO_FILE
  65. #  define VIMINFO_FILE    "$VIM\\viminfo"
  66. # endif
  67. #endif /* VIMINFO */
  68.  
  69. #ifndef DEF_BDIR
  70. # define DEF_BDIR        ".,c:\\tmp,c:\\temp"    /* default for 'backupdir' */
  71. #endif
  72.  
  73. #ifndef DEF_DIR
  74. # define DEF_DIR        ".,c:\\tmp,c:\\temp"    /* default for 'directory' */
  75. #endif
  76.  
  77. #define TMPNAME1        "viXXXXXX"        /* put it in current dir */
  78. #define TMPNAME2        "voXXXXXX"        /*  is there a better place? */
  79. #define TMPNAMELEN        15
  80.  
  81. #include <stdlib.h>
  82.  
  83. /*
  84.  * Win32 has plenty of memory, use large buffers
  85.  */
  86. #define CMDBUFFSIZE    1024        /* size of the command processing buffer */
  87. #ifdef _MAX_FNAME                /* just in case it's not defined for Borland */
  88. # define MAXNAMLEN    _MAX_FNAME
  89. #endif
  90. #define MAXPATHL    _MAX_PATH    /* Win32 has long paths and plenty of memory */
  91.  
  92. #ifndef MAXMEM
  93. # define MAXMEM            512            /* use up to  512 Kbyte for buffer */
  94. #endif
  95.  
  96. #ifndef MAXMEMTOT
  97. # define MAXMEMTOT        2048        /* use up to 2048 Kbyte for Vim */
  98. #endif
  99.  
  100. #define BASENAMELEN        (MAXPATHL-5)    /* length of base of filename */
  101.  
  102. /* codes for Win32 mouse event */
  103. #define MOUSE_LEFT        0x00
  104. #define MOUSE_MIDDLE    0x01
  105. #define MOUSE_RIGHT        0x02
  106. #define MOUSE_RELEASE    0x03
  107.  
  108. #define MOUSE_CLICK_MASK    0x03
  109.  
  110. #define MOUSE_SHIFT        0x04
  111. #define MOUSE_ALT        0x08
  112. #define MOUSE_CTRL        0x10
  113.  
  114. /* 0x20 is reserved */
  115.  
  116. #define MOUSE_DRAG        (0x40 | MOUSE_RELEASE)
  117.  
  118. #define NUM_MOUSE_CLICKS(code) ((((code) & 0xC0) >> 6) + 1)
  119.  
  120. #define SET_NUM_MOUSE_CLICKS(code, num) \
  121.     (code) = ((code) & 0x3f) | (((num) - 1) << 6)
  122.  
  123. /* Work around a bug in Windows 95's rename() */
  124. int win95rename(const char* pszOldFile, const char* pszNewFile);
  125. #define rename(old, new)  win95rename(old, new)
  126.